package com.feib.soeasy.dao.hibernate;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.jfree.util.Log;
import org.springframework.stereotype.Repository;

import com.feib.soeasy.dao.ColumnDefinitionDao;
import com.feib.soeasy.model.ColumnDefinition;
import com.feib.soeasy.model.FormatDefinition;
import com.feib.soeasy.model.Payment;

@Repository("columnDefinitionDao")
public class ColumnDefinitionHibernateDao extends BaseHibernateDao<ColumnDefinition, Long> 
		implements ColumnDefinitionDao {

	@Override
	public List<ColumnDefinition> queryColumnDefinitions(
			FormatDefinition formatDefinition) {
		Criteria criteria = getSession().createCriteria(ColumnDefinition.class);
		criteria.add(Restrictions.eq("formatDefinition", formatDefinition));
		criteria.addOrder(Order.asc("beginIndex"));
		return criteria.list();
	}


}
